/**============================================================================
 Confidential Information - Limited distribution to authorized persons only.
 This software is protected as an unpublished work under the U.S. Copyright
 Act of 1976.

 Copyright (c) 2012, BluePhoenix Solutions, Inc. All rights reserved.
 ----------------------------------------------------------------------------
 file......: ErrorDialog.java
 Author....: Vyacheslav Kovalyov
 Created...: 1/2/12

 Description:

 ============================================================================*/
package com.bphx.android.activities.dialogs;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import com.bphx.android.R;

import static com.bphx.android.R.string.error;
import static com.bphx.android.R.string.textOk;

/**
 * @author Vyacheslav Kovalyov
 * @version 1.0
 */
public class ErrorDialog extends AlertDialog {

    public ErrorDialog(Context context, int id) {
        this(context, context.getString(id));
    }

    public ErrorDialog(Context context, String errorMessage) {
        super(context);

        setTitle(error);
        setIcon(R.drawable.error);
        setMessage(errorMessage);

        setButton(context.getString(textOk), new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                cancel();
            }
        });
    }
}
